diff --git a/plugin/ADs/ADs.php b/plugin/ADs/ADs.php index 19c49751c..c48b73760 100644 --- a/plugin/ADs/ADs.php +++ b/plugin/ADs/ADs.php @@ -1,112 +1,121 @@ Help"; $help = ""; return $txt . $help; } public function getName() { return "ADs"; } public function getUUID() { return "ADs73225-3807-4167-ba81-0509dd280e06"; } public function getPluginVersion() { return "1.0"; } public function getEmptyDataObject() { global $global,$config; $obj = new stdClass(); $adsense = $config->getAdsense(); $o = new stdClass(); $o->type = "textarea"; $o->value = empty($adsense)?"":$adsense; $obj->leaderBoardTop = $o; $o = new stdClass(); $o->type = "textarea"; $o->value = empty($adsense)?"":$adsense;; $obj->leaderBoardMiddle = $o; $o = new stdClass(); $o->type = "textarea"; $o->value = empty($adsense)?"
":$adsense;; $obj->leaderBoardBigVideo = $o; $o = new stdClass(); $o->type = "textarea"; $o->value = empty($adsense)?"
":$adsense;; $obj->leaderBoardBigVideoMobile = $o; /* $o = new stdClass(); $o->type = "textarea"; $o->value = empty($adsense)?"":$adsense;; $obj->leaderBoardFooter = $o; * */ $o = new stdClass(); $o->type = "textarea"; $o->value = empty($adsense)?"":$adsense;; $obj->sideRectangle = $o; $o = new stdClass(); $o->type = "textarea"; $o->value = empty($adsense)?"":$adsense;; $obj->leaderBoardTopMobile = $o; $o = new stdClass(); $o->type = "textarea"; $o->value = empty($adsense)?"":$adsense;; $obj->leaderBoardMiddleMobile = $o; /* $o = new stdClass(); $o->type = "textarea"; $o->value = empty($adsense)?"":$adsense;; $obj->leaderBoardFooterMobile = $o; * */ $obj->tags3rdParty = ""; return $obj; } public function getHeadCode() { if(!empty($_GET['videoName'])){ $obj = $this->getDataObject(); if(!empty($obj->tags3rdParty)){ $v = Video::getVideoFromCleanTitle($_GET['videoName']); if(!empty($v)){ - $tag = str_replace(array('{ChannelName}','{Category}'), array(addcslashes($v["channelName"],"'"), addcslashes($v["category"],"'")), $obj->tags3rdParty); + $channelName = $v["channelName"]; + $category = $v["category"]; + if(!empty($_GET['channelName'])){ + $channelName = preg_replace('/[^a-zA-Z0-9_ -]/', '', $_GET["channelName"]); + } + if(!empty($_GET['category'])){ + $category = preg_replace('/[^a-zA-Z0-9_ -]/', '', $_GET["category"]); + } + + $tag = str_replace(array('{ChannelName}','{Category}'), array(addcslashes($channelName,"'"), addcslashes($category,"'")), $obj->tags3rdParty); return $tag; } } }else if(!empty($_GET['catName'])){ $obj = $this->getDataObject(); if(!empty($obj->tags3rdParty)){ $v = Category::getCategoryByName($_GET['catName']); if(!empty($v)){ $tag = str_replace(array(',','{ChannelName}','{Category}'), array('', '', addcslashes($v["name"],"'")), $obj->tags3rdParty); return $tag; } } } return ''; } public function getTags() { return array('free'); } } \ No newline at end of file